@echo off
DEL /F /A /Q bin
DEL /F /A /Q dist

SET TARGET_FILE_NAME=http2mqtt
SET CGO_ENABLED=0
SET GOOS=darwin
SET GOARCH=amd64
SET TARGET=%TARGET_FILE_NAME%_%GOOS%_%GOARCH%_%1
go build -ldflags="-w -s" -o bin/%TARGET%
7z a dist/%TARGET%.7z bin/%TARGET%

SET CGO_ENABLED=0
SET GOOS=linux
SET GOARCH=amd64
SET TARGET=%TARGET_FILE_NAME%_%GOOS%_%GOARCH%_%1
go build -ldflags="-w -s" -o bin/%TARGET%
7z a dist/%TARGET%.7z bin/%TARGET%

SET CGO_ENABLED=0
SET GOOS=windows
SET GOARCH=amd64
SET TARGET=%TARGET_FILE_NAME%_%GOOS%_%GOARCH%_%1
go build -ldflags="-w -s" -o bin/%TARGET%.exe
7z a dist/%TARGET%.7z bin/%TARGET%.exe

SET CGO_ENABLED=0
SET GOOS=freebsd
SET GOARCH=amd64
SET TARGET=%TARGET_FILE_NAME%_%GOOS%_%GOARCH%_%1
go build -ldflags="-w -s" -o bin/%TARGET%
7z a dist/%TARGET%.7z bin/%TARGET%